﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WHM3
{
    public static class Utils
    {
        public static string formatDate(String date)
        {
            string result="";

            string[] split1 = date.Split(new string[] { "::" }, StringSplitOptions.None);
            
            result += split1[0]+"::";
            
            //hour
            string[] split2 = split1[1].Split(':');
            if (split2[0].Length < 2)
            {
                result += "0" + split2[0];
            }
            else
            {
                result += split2[0];
            }
            result += ":";
            //minute
            if (split2[1].Length < 2)
            {
                result += "0" + split2[1];
            }
            else
            {
                result += split2[1];
            }

            return result;
        }

        public static string getddmmyyyy(string date)
        {
            return date.Split(new string[] { "::" }, StringSplitOptions.None)[0];
        }
    }
}